<template>
  <div class="hm-article">
    <div class="topNav">
      <div class="left">
        <a
          href="http://localhost:8080/#/layout/article/recommend"
          :class="{ active: active === 0 }"
          @click="active = 0"
          >推荐</a
        >
        <a
          href="http://localhost:8080/#/layout/article/new"
          :class="{ active: active === 1 }"
          @click="active = 1"
          class="news"
          >最新</a
        >
        <img src="../assets/logo.png" alt="" class="logo" />
      </div>
    </div>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "HmArticle",
  data() {
    return {
      active: 0,
    };
  },
};
</script>

<style lang="less" scoped>
.hm-article {
  .topNav {
    position: fixed;
    top: 0;
    z-index: 9999;
    width: 100%;
    background-color: #fff;
    a {
      display: inline-block;
      color: #999;
      width: 50px;
      height: 20px;
      text-align: center;
      margin-top: 20px;
      line-height: 10px;
      margin-bottom: 5px;
    }
    .active {
      color: #000;

      transition: all 0.5s;
    }
    a.active::after {
      width: 5px;
      height: 2px;
      background-color: #000;
    }
    .left {
      display: flex;
    }
    .news {
      flex: 1;
      text-align: left;
    }
    .left .logo {
      width: 30px;
      height: 30px;
      align-items: center;
      margin-top: 10px;
      margin-right: 10px;
    }
  }
}
</style>
